package com.nut.lmsc.util;

import java.util.concurrent.ThreadLocalRandom;

public class CharUtil {

    public static final String RANDOM_STRING = "abcdefghijklmnopqrstuvwxyz0123456789";

    public static String getRandomString(Integer num) {
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < num; i++) {
            sb.append(RANDOM_STRING.charAt(ThreadLocalRandom.current().nextInt(RANDOM_STRING.length())));
        }
        return sb.toString();
    }

    public static String getRandomNum(Integer num) {
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < num; i++) {
            sb.append(ThreadLocalRandom.current().nextInt(10));
        }
        return sb.toString();
    }

	public static void main(String[] args) {

		for (int i = 0; i < 20; i++) {
//			System.out.println(getRandomString(16));
			System.out.println(getRandomNum(12));
		}

	}

}
